package club.ruanx.movie.repository;


import club.ruanx.core.repository.base.BaseRepository;
import club.ruanx.movie.entity.News;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.Optional;

/**
 * @author 阮胜
 * @date 2018/11/11 19:50
 */
public interface NewsRepository extends BaseRepository<News, String> {
    Page<News> findAllByOrderByCreateTimeDesc(Pageable pageable);

    Optional<News> findTop1ByOrderByCreateTimeDesc();
}
